<script type="text/javascript" src="/js/change.js" language="javascript" ></script>
 <?php if($_SESSION['config_template']=='layoutmain_web1') {?>
	<?php
        if(isset($_GET['id']))
			foreach ($DescriptionNews as $DescriptionNews){?>
 				<div class="product_top"><span></span></div>
				<div class="product-info-box">
					<div class="product-collateral">
						<div class="collateral-box">
							<div style="height:30px;padding:8px;">
								<h1 style="font-weight:bold; float:left; height:30px;"><?php echo $DescriptionNews['title'];?></h1>
								<span style="float:right; height:30px; margin-top:10px;">(<?php echo $Update_Date;?>)</span>
							</div>
							
							<?php if (isset($permission)&&($permission =="true")){?>
								<div style="float:left;margin-left:5px;">
									<!-- Pencil -->
									<a style = "font-size:12;line-height:15px;" href="javascript:;" <?php if($DescriptionNews['type']==2){?>onclick = "popUnder('/news/post?path=<?php echo $_GET['id']; ?>');"<?php }else if($DescriptionNews['type']==1){?>onclick = "popUnder('/admin/editor?item=thing&id=<?php echo $_GET['id']; ?>');"<?php }?>>
										<img src="/images/Pencil.png" style="width:20px ; height:20px;"></img>
									</a>
									<!-- nut del -->						
									<input type="button"  id="<?php echo $_GET['id'];?>" onclick="del_news(<?php echo $_GET['id'];?>);"  value="" style="background-image: url('/images/button_del.png'); border: none; width: 20px;height: 20px; margin-left : 3px;line-height:30px;">												
									<!-- end nut del -->
								</div>
							<?php }?>
							<div class="head">
								<h5><?php echo $DescriptionNews['title'];?></h5>
								<a  href="javascript:;" onclick="addLike(<?php echo $_GET['id'];?>)"><img title="" alt="" src="/images/thumb-up.png" style="width:25px;"></a>
								(<span id="num_like" style="margin-top:5px;"><?php echo $CountLike;?></span>)
							</div>
							<div style=" text-align:center;">
								<img style="width: 265px;" title="" alt="" src="<?php echo $DescriptionNews['avatar'];?>" id="image">
							</div>
							<div style="text-align:justify;padding:10px;"><?php echo $DescriptionNews['description'];?></div>            
						</div>
					</div>
				</div>
<div class="product_bottom"><span></span></div>&nbsp;
					<?php } ?>
<?php } else if($_SESSION['config_template']=='layoutmain_web2') { ?>
  				<?php
                    if(isset($_GET['id']))
						foreach ($DescriptionNews as $DescriptionNews){?>
 					<div class="product-info-box">
							<div class="product-collateral">
								<div class="collateral-box">
									<div style="height:30px;">
										<h3 style="font-weight:bold; float:left; height:30px;"><?php echo $DescriptionNews['title'];?></h3>
										<span style="float:right; height:30px;">(<?php echo $Update_Date;?>)</span>
										<?php if (isset($permission)&&($permission =="true")){?>
											<div style="float:left;margin-left:5px;">
											<!-- Pencil -->
											<a style = "font-size:12;line-height:15px;" href="javascript:;" <?php if($DescriptionNews['type']==2){?>onclick = "popUnder('/news/post?path=<?php echo $_GET['id']; ?>');"<?php }else if($DescriptionNews['type']==1){?>onclick = "popUnder('/admin/editor?item=thing&id=<?php echo $_GET['id']; ?>');"<?php }?>>
												<img src="/images/Pencil.png" style="width:20px ; height:20px;"></img>
											</a>
											<!-- nut del -->						
											<input type="button"  id="<?php echo $_GET['id'];?>" onclick="del_news(<?php echo $_GET['id'];?>);"  value="" style="background-image: url('/images/button_del.png'); border: none; width: 20px;height: 20px; margin-left : 3px;line-height:30px;">												
											<!-- end nut del -->
										</div>
										<?php }?>
									</div>
									<div class="head">
										<h5><?php echo $DescriptionNews['title'];?></h5>
										<a  href="javascript:;" onclick="addLike(<?php echo $_GET['id'];?>)"><img title="" alt="" src="/images/thumb-up.png" style="width:25px;"></a>
										(<span id="num_like" style="margin-top:5px;"><?php echo $CountLike;?></span>)
									</div>
									<div style=" text-align:center;">
										<img style="width: 265px;" title="" alt="" src="<?php echo $DescriptionNews['avatar'];?>" id="image">
									</div>
									<div style="text-align:justify;">
										<?php echo $DescriptionNews['description'];?>
									</div>            
								</div>
							</div>
						</div>
					<?php } ?>
 <?php } else { ?>
 			<link rel="stylesheet" type="text/css" href="/css/description.css" />
		
 			<div >
                    <?php
                    if(isset($_GET['id']))
						foreach ($DescriptionNews as $DescriptionNews){?>
							<div id="">  
								<div >
									<div style="float:left;"><p><?php echo $DescriptionNews['title'];?></p></div>
									<?php if (isset($permission)&&($permission =="true")){?>
									<div style="float:left;margin-left:5px;">
										<!-- Pencil -->
										<a style = "font-size:12;line-height:15px;" href="javascript:;" <?php if($DescriptionNews['type']==2){?>onclick = "popUnder('/news/post?path=<?php echo $_GET['id']; ?>');"<?php }else if($DescriptionNews['type']==1){?>onclick = "popUnder('/admin/editor?item=thing&id=<?php echo $_GET['id']; ?>');"<?php }?>>
											<img src="/images/Pencil.png" style="width:20px ; height:20px;"></img>
										</a>
										<!-- nut del -->						
										<input type="button"  id="<?php echo $_GET['id'];?>" onclick="del_news(<?php echo $_GET['id'];?>);"  value="" style="background-image: url('/images/button_del.png'); border: none; width: 20px;height: 20px; margin-left : 3px;line-height:30px;">												
										<!-- end nut del -->
									</div>
									<?php }?>
									<div style="float:right;font-size:15px;"><?php echo $Update_Date;?></div>
									<div class="line"><hr></div>
								</div>
								<div style="float:left;">
									<span ><?php echo $DescriptionNews['title'];?></span><br/>
								</div>  
								<div id="like" style="float: right; width:55px; margin-top:8px;"> 	
									<div class="btn" style="background-image:url('/images/like.png');width:54px; height:36px; float:right;" onclick="addLike(<?php echo $_GET['id'];?>)">
											<p align="center" style="width:100%; margin-top:15px; color: green;" id="num_like"><?php echo $CountLike;?></p>	
									</div>
								</div>
								<div style="width: 100%;clear: both; float:left;margin-top:10px;max-width:700px;overflow: hidden;" align="center"> <img src="<?php echo $DescriptionNews['avatar'];?>" alt="" /></div>
								<div style="width: 100%;clear: both; float:left;margin-top:10px;"><span class="description_news"><?php echo $DescriptionNews['description'];?></span></div>
								<div style="margin-top:40px;clear: both; float:left;"></div>
							</div>
                    <?php }?>
              </div>
               <?php } ?>
              <div style="clear: both;margin-top:80px;"></div>
              <script type="text/javascript">
function del_news(id)
{ 
	var news_id=id;
	var confirmed=confirm(<?php echo "'".$textConfirm."'";?>);
	if(confirmed==true)
{
if (window.XMLHttpRequest)
	{// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp=new XMLHttpRequest();
		
	}
	else
	{// code for IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange = function()
	{	if (xmlhttp.readyState==4 && xmlhttp.status==200)
		{
		history.go(-1);
		}
	};
	
	var url = "/descriptionthing/clickchange/delete?id="+news_id;
	xmlhttp.open("GET",url,true);	
	xmlhttp.send();
	return false;
}
}
</script>

<script type="text/javascript">

function popUnder(url)
{
var w = 800;
var h = 600;
props = "width=" + w + ",";
props += "height=" + h + ",";
props += "titlebar=0,";
props += "toolbar=0,";
props += "location=0,";
props += "menubar=0," ;
props += "scrollbars=1," ;
props += "resizable=0," ;
props += "channelmode=0," ;
props += "directories=0," ;
props += "status=0";

var popwin = window.open("","popwin",props,true);
popwin.location = url ;

self.focus();

}
</SCRIPT>


